package com.cosin.controller;

import com.cosin.model.dto.RiskDataDTO;
import com.cosin.service.ScreenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.PermitAll;
import java.util.List;

@RestController
@RequestMapping("/screen")
public class ScreenController {
    @Autowired
    ScreenService screenService;
    // 公司分布以及风险数量
    @PermitAll
    @GetMapping("/companyDistribution")
    public List<RiskDataDTO> companyDistribution(int userId) {
        System.out.println("开始访问--------------------");
        screenService.companyDistribution(userId);
        return  screenService.companyDistribution(userId);
    }
    @GetMapping("/ping")
    public String ping() {
        return "pong";
    }
}
